package com.scau.handleException;

/**
 * 统一返回结果类
 * Siaoja
 */
public class ApiResult {
    private String code;
    private String msg;

    public ApiResult(){

    }

    public ApiResult(ResultCode resultCode){
        this.code = resultCode.getStatus();
        this.msg = resultCode.getMsg();
    }

    public static ApiResult of(ResultCode resultCode){
        return new ApiResult(resultCode);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "ApiResult{" +
                "code='" + code + '\'' +
                ", msg='" + msg + '\'' +
                '}';
    }
}
